﻿using DevExpress.ExpressApp.Blazor.Editors.Adapters;
using DevExpress.ExpressApp.Editors;
using DevExpress.ExpressApp.Utils;
using EasyXaf.EntityDesigner.BusinessObjects.Entities.EntityViews;
using Microsoft.AspNetCore.Components;

namespace EasyXaf.EntityDesigner.Editors.DetailViewEditors;

public class DetailViewEditorAdapter : ComponentAdapterBase
{
    public override DetailViewEditorModel ComponentModel { get; }

    public DetailViewEditorAdapter(DetailViewEditorModel model)
    {
        ComponentModel = model;
    }

    protected override RenderFragment CreateComponent() => DetailViewEditorRenderer.Create(ComponentModel);

    public override object GetValue() => ComponentModel.View;

    public override void SetValue(object value) => ComponentModel.View = value as EntityView;

    public override void SetAllowEdit(bool allowEdit) { }

    public override void SetAllowNull(bool allowNull) { }

    public override void SetDisplayFormat(string displayFormat) { }

    public override void SetEditMask(string editMask) { }

    public override void SetEditMaskType(EditMaskType editMaskType) { }

    public override void SetErrorIcon(ImageInfo errorIcon) { }

    public override void SetErrorMessage(string errorMessage) { }

    public override void SetIsPassword(bool isPassword) { }

    public override void SetMaxLength(int maxLength) { }

    public override void SetNullText(string nullText) { }
}
